#ifndef _MS_CYLINDER_H_
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>

#include "ms_misc.h"
#include "ms_voxelimage.h"

class cylinder ;

class cylinder  {
	private:
		double xmin, xmax, ymin, ymax, zmin, zmax;
	public:
		double	P[3], Q[3], D[3],	/* From P to Q, D= Q-P */
				R, L, vol,			/* Radius, length and volume */
				N[3];				/* normal vector */

	public:
		cylinder( const double r=1. );
		cylinder( const double p[3], const double q[3], const double r=1.);
		
		void   Displace( const double dx[] );
		void   MoveTo( const double xx[] );
		inline void   SetRadius( const double r ) { R=r; }
		
		void   CalculateMinMax();
		void   DrawVoxelImage(	VoxelImage & vx_img,
						const unsigned char col = 1 ) ;
/*		inline double GetXMin() const { return X[0]-R; }
		inline double GetXMax() const { return X[0]+R; }
		inline double GetYMin() const { return X[1]-R; }
		inline double GetYMax() const { return X[1]+R; }
		inline double GetZMin() const { return X[2]-R; }
		inline double GetZMax() const { return X[2]+R; }*/
		
// 		double	Distance(const cylinder & s)  const ;
// 		bool	Collision(const cylinder & s) const ;
// 		double	IntersectionVolume(const sphere & s) const ;

// 		void	DrawVoxelImage(	VoxelImage & vx_img,
// 						const unsigned char col = 1 ) const ;
};

#define _MS_CYLINDER_H_
#endif /* _MS_CYLINDER_H_ */
